﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Teacher tea = new Teacher();
            tea.Tid = 2142345;
            tea.Name = "李四";
            tea.Sex = '男';
            tea.Tel = 123454534;
            tea.Title = "校长";
            tea.Wageno = 124234;
            tea.our();

            Student st = new Student();
            st.Sid = 214554;
            st.Name = "阿斯顿";
            st.Sex = '女';
            st.Tel = 1243536;
            st.Major = "软件技术";
            st.Grade = "20级";
            st.our();
        }
    }
    class Person
    {
        private string name;
        private char sex;
        private string cardid;
        private int tel;

        public string Name
        {
            get { return this.name; }
            set { this.name = value; }
        }
        public char Sex
        {
            get { return this.sex; }
            set { this.sex = value; }
        }
        public string Cardid
        {
            get { return this.cardid; }
            set { this.cardid = value; }
        }
        public int Tel
        {
            get { return this.tel; }
            set { this.tel = value; }
        }

        public Person()
        {

        }
        public Person(string name, char sex, string cardid, int tel)
        {
            this.name = name;
            this.sex = sex;
            this.tel = tel;
            this.cardid = cardid;
        }
        public void our()
        {
            Console.WriteLine("姓名为{0},性别是{1}、身份证号为{2}、联系方式{3}", this.name, this.sex, this.cardid, this.tel);
        }
    }
    class Student : Person
    {
        private int sid;
        private string major;
        private string grade;

        public int Sid
        {
            get { return this.sid; }
            set { this.sid = value; }
        }
        public string Major
        {
            get { return this.major; }
            set { this.major = value; }
        }
        public string Grade
        {
            get { return this.grade; }
            set { this.grade = value; }
        }

        public Student()
        {

        }
        public Student(int sid, string major, string grade)
        {
            this.sid = sid;
            this.major = major;
            this.grade = grade;
        }
        public void our()
        {
            base.our();
            Console.WriteLine("编号为{0},专业是{1},年级是{2}", this.sid, this.major, this.grade);
        }
    }
    class Teacher : Person
    {
        private int tid;
        private string title;
        private int wageno;

        public int Tid
        {
            get { return this.tid; }
            set { this.tid = value; }
        }
        public string Title
        {
            get { return this.title; }
            set { this.title = value; }
        }
        public int Wageno
        {
            get { return this.wageno; }
            set { this.wageno = value; }
        }
        public Teacher()
        { }
        public Teacher(int tid, string title, int wageno)
        {
            this.tid = tid;
            this.title = title;
            this.wageno = wageno;
        }
        public void our()
        {
            base.our();
            Console.WriteLine("编号为{0},职称是{1},工资号是{2}", this.tid, this.title, this.wageno);
        }
    }
}
